const webpack = require('webpack')
module.exports = {
  publicPath: './',
  outputDir: '../back-end/public/',
  transpileDependencies: ['vuetify'],
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'windows.jQuery': 'jquery'
      })
    ]
  },
  // 开发时使用的映射
  devServer: {
    proxy: {
      '/socket.io': {
        target: 'http://localhost:3000',
        ws: true,
        changeOrigin: true
      },
      'sockjs-node': {
        target: 'http://localhost:3000',
        ws: false,
        changeOrigin: true
      },
      '/api': {
        target: 'http://localhost:3000',
        changOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': '/api'
        }
      },
      '/': {
        target: 'http://localhost:3000',
        changOrigin: true
      }
    }
  }
}
